# default way to make executables
%.exe: %.cs
	$(MCS) $(MCSFLAGS) -target:exe -out:$@ $(filter %.cs,$^) $(NBODYFRAMEWORK_LIBS) $(OPTIONPARSER_LIBS) $(PGPLOT_LIBS)

# default way to make executables ... from boo files
%.exe: %.boo
	booc $(filter %.boo,$^)
	
ALL = DataPlot NBodyAngularMomentum NBodyAnimate NBodyAzimuthal NBodyBar NBodyBullock NBodyConvert NBodyCube2 NBodyCube NBodyDehnen NBodyDensity NBodyDF NBodyEnergy NBodyFakeNFW NBodyFromDF NBodyHead NBodyImage NBodyInfo NBodyInit NBodyMorphology NBodyNumberDensity NBodyPlummer NBodyPositions NBodyPotential NBodyRandomCube NBodyRotate NBodyTrim NBodyVelDisp NBodyVelocity

# need to do wrapper scripts, too
programwrapdir = $(bindir)
programwrap_SCRIPTS = $(ALL)

programdir = $(pkglibdir)
program_SCRIPTS = $(ALL:=.exe)

EXTRA_DIST = $(program_sources) $(program_sources_in) *.cs *.boo
CLEANFILES = $(ALL) $(ALL:=.exe) *.mdb
DISTCLEANFILES = Makefile.in

$(ALL):
	echo -e "#!/bin/sh \nexec @MONO@ @prefix@/lib/@PACKAGE@/$@.exe \"\$$@\"" >> $@
	chmod a+x $@
